<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "dd_menu_cate".
 *
 * @property int $id
 * @property string|null $name
 * @property string|null $mark
 * @property string|null $create_time
 * @property string|null $update_time
 */
class DdMenuCate extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'dd_menu_cate';
    }

    /**
     * 行为
     */
    public function behaviors()
    {
        /*自动添加创建和修改时间*/
        return [
            [
                'class' => \common\behaviors\SaveBehavior::className(),
                'updatedAttribute' => 'create_time',
                'createdAttribute' => 'update_time',
            ]
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['name', 'mark'], 'string', 'max' => 255],
            [['create_time', 'update_time'], 'string', 'max' => 30],
            [['sort'], 'integer']
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => '导航名称',
            'mark' => '导航英文标识',
            'sort' => '排序',
            'create_time' => '创建时间',
            'update_time' => '更新时间',
        ];
    }
}
